package com.zsc.newbuds.controller;
import java.util.ArrayList;
import	java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zsc.newbuds.service.AdminService;
import com.zsc.newbuds.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author D
 */
@RestController
public class IndexController {

    @Autowired
    RedisUtil redisUtil;

    @Resource
    private AdminService adminService;


    @GetMapping({"/getData","main/getData"})
    public Map<String, Object> getData(){
        return adminService.getStatistic();
    }


    @GetMapping("/getCountData")
    public double[] getCountData() {
        return adminService.getMoneyOfMonth();
    }

    @GetMapping("/getChartData")
    public Map<String, Object[]> getChartData() {
        return adminService.getDonationStatistic();
    }

}
